<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
	<xsl:output method="xhtml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
	<!-- XML Comment Documentation -->
	<xsl:template match="summary">
		<div class="summary">
			<div class="summaryTitle">Summary</div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="remarks">
		<div class="remarks">
			<div class="remarksTitle">Remarks</div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="example">
		<div class="example">
			<div class="exampleTitle">Example</div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="exception">
		<div class="exception">
			<div class="exceptionTitle">Exception</div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="include">
		<div class="include">
			<div class="includeTitle">Include</div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<!-- Param is not displayed as a seperate section, but as part of parameters table -->
	<xsl:template match="param"/>
	<xsl:template match="permission">
		<div class="permission">
			<div class="permissionTitle">Permission</div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="returns">
		<div class="returns">
			<div class="returnsTitle">Returns: </div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<xsl:template match="value">
		<div class="value">
			<div class="valueTitle">Value: </div>
			<xsl:value-of select="."/>
		</div>
	</xsl:template>
	<!-- SeeAlso is a special case, it's partly handled in the devnote template-->
	<xsl:template match="seealso">
		<div class="seealso">
			<xsl:if test="string-length(@cref) > 0">
				<a href="{@cref}.html">
					<xsl:value-of select="."/>
				</a>
			</xsl:if>
			<xsl:if test="string-length(@href) > 0">
				<a href="{@href}">
					<xsl:value-of select="."/>
				</a>
			</xsl:if>
		</div>
	</xsl:template>
	<!-- END: XML Comment Documentation -->

	<xsl:template match="parameters">
		<table class="parameters">
			<tbody>
				<tr class="parametersTitle">
					<td>Name</td>
					<td>Type</td>
					<td>Description</td>
				</tr>
				<xsl:apply-templates select="parameter"/>
			</tbody>
		</table>
	</xsl:template>
	<xsl:template match="parameter">
		<tr class="parameter">
			<td>
				<xsl:value-of select="@name"/>
			</td>
			<td>
				<xsl:value-of select="@type"/>
			</td>
			<td>
				<!-- Extract Description out from devnotes. This will only work if the Microsoft Comment Document or NDoc format was followed -->
				<xsl:variable name="name" select="@name"/>
				<xsl:value-of select="../../devnotes/param[@name=$name]"/>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>
